#pragma once

/*
自定义委托类
*/
#include <QItemDelegate>
#include <QSpinBox>
#include <QDoubleSpinBox>
#include <QComboBox>
#include <QStandardItemModel>
#include <QLineEdit>
#include <QDebug>

#define FS_WHITE_BRUSH QBrush((QColor(255, 255, 255)))
#define FS_RED_BRUSH QBrush((QColor(255, 0, 0)))
#define FS_GREEN_BRUSH QBrush((QColor(0, 255, 0)))

enum class DELEGATE_TYPE
{
    READONLY,     //只读委托
    EDIDTEXT,     //可修改文本框委托
    COMBOBOX,     //组合框
    PASSWDLINE,   //密码修改框

};
//  只读委托
class ReadOnlyDelegate : public QItemDelegate
{
    Q_OBJECT

public:
    ReadOnlyDelegate(QObject *parent = 0) : QItemDelegate(parent) { }

    QWidget *createEditor(QWidget*parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
    {
        Q_UNUSED(parent)
        Q_UNUSED(option)
        Q_UNUSED(index)
        return nullptr;
    }
};

